/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin			*/
/*	Project:	GlbCloud			*/
/*	Author:		gong_libin			*/
/*	Date:		2012_01_11			*/
/*	File:		MrSet.h				*/
/********************************************************/

#ifndef _MRSET_H
#define	_MRSET_H

typedef int (*MrSetCompPtr)(const void*, const void*);

#include "MrGlobal.h"

class CMrSet
{
public:
	CMrSet();
	virtual ~CMrSet();

	void* MrSetGetSet();
	UINT MrSetGetSize();
	UINT MrSetGetCount();
	MrSetCompPtr MrSetGetCompare();

	void MrSetPutSet(void* pSet);
	void MrSetPutSize(UINT uiSize);
	void MrSetPutCount(UINT uiCount);

	void MrSetSort();
	void MrSetOrder();
	void MrSetDestroy();
	long MrSetIndex(void* pKey);
	void MrSetClone(CMrSet& CSet);
	void* MrSetIndexGet(UINT uiIndex);
	void MrSetIndexErase(UINT uiIndex);
	bool MrSetIndexIsNull(UCHAR* pucCur);
	int MrSetInit(UINT uiTotal, UINT uiSize);
	int MrSetSearch(void* pKey, void* pData);
	void MrSetCompare(MrSetCompPtr pCompare);
	UINT MrSetIndexPut(UINT uiIndex, void* pData);

private:
	void* m_pSet;
	UINT m_uiSize;
	UINT m_uiCount;
	MrSetCompPtr m_pCompare;

};

#endif /* _MRSET_H */
